﻿#region Imports Directives

using System;
using System.Collections.Generic;
using System.Text;
using Quartz;
using log4net;

#endregion

namespace Scenario.WorkflowEngine.Events.Jobs
{
    public abstract class ScenarioJob : Quartz.IJob
    {
        public const string CLASSID_TAG = "ClassId";
        public const string PROCESSXML_TAG = "ProcessXML";
        public const string WAPIXML_TAG = "WAPIXML";

        #region Variables

        Int32 _ClassId;
        String _ProcessXML;
        String _WapiXML;

        private static ILog _log =LogManager.GetLogger(typeof(ScenarioJob));

        #endregion

        #region Constructor

        public ScenarioJob()
        {
        }

        #endregion

        #region Properties

        public Int32 ClassId
        {
            get
            {
                return this._ClassId;
            }
            set
            {
                this._ClassId = value;
            }
        }
        public string ProcessXML
        {
            get
            {
                return this._ProcessXML;
            }
            set
            {
                this._ProcessXML = value;
            }
        }
        public string WapiXML { 
            get {
                return this._WapiXML;
            } 
            set {
                this._WapiXML = value;
            } 
        }

        #endregion

        void Quartz.IJob.Execute(Quartz.JobExecutionContext context)
        {
            JobDataMap dataMap = context.JobDetail.JobDataMap;

            this.Run(context);
        }

        public abstract void Run(Quartz.JobExecutionContext context);
    }
}
